package com.foreveross.bsl.web;

import java.util.List;

import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 * 菜单类，页面的主导航菜单实例是通过sping配置bean创建的，其scope是request
 * @author Wangyi
 * @version v1.0
 *
 * @date 2013-7-5
 *
 */
public class Menu {
	private MenuItem currentMenuItem;
	private List<MenuItem> menuItems;

	public MenuItem getCurrentMenuItem() {
		return currentMenuItem;
	}

	public void setCurrentMenuItem(MenuItem currentMenuItem) {
		this.currentMenuItem = currentMenuItem;
	}

	public List<MenuItem> getMenuItems() {
		return menuItems;
	}

	public void setMenuItems(List<MenuItem> menuItems) {
		for(MenuItem item : menuItems){
			item.setOwner(this);
		}
		this.menuItems = menuItems;
	}
	
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}
